<!DOCTYPE html>
<html class="reftest-wait">
  <meta charset="utf-8">
  <title>content-visibility and intrinsic size</title>
  <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1880928">
  <link rel="match" href="content-visibility-intrinsic-size-001-ref.html">
  <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
  <meta name="assert" content="Rendering of should stabilize, with all the 'content-visibility: auto' divs becoming close to viewport.">
  <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
  <script src="/common/rendering-utils.js"></script>
  <style>
    #container {
        position: sticky;
    }
    #container > div {
        font: 25px/1 Ahem;
        content-visibility: auto;
        contain-intrinsic-size: 1px 5000px;
    }
  </style>
  <div id="container">
    <div>X</div>
    <div id="target">XX</div>
    <div>XXX</div>
    <div>XXXX</div>
  </div>
  <script>
    target.scrollIntoView();
    document.fonts.ready.then(() => {
        waitForAtLeastOneFrame().then(() => {
            document.documentElement.classList.remove("reftest-wait");
        });
    });
  </script>
</html>
